Image data processing device and method

ABSTRACT

The present invention provides an image data processing method of recording image data coded with the MPEG (Moving Picture Experts Group) technique to a recording medium. For transition of the bit occupancy in a VBV buffer to a target value, the initial value of a bit occupancy in a VBV buffer is calculated on the basis of auxiliary data read from a recording medium, a comparison is made between the target and initial values of the bit occupancy, and the number of bits for assignment to each GOP of to-be-coded image data correspondingly to the result of comparison.

TECHNICAL FIELD

The present invention relates to an image data processing apparatus for,and an image data processing method of, recording image data encodedwith the MPEG (Moving Picture Expert Group) technique to a recordingmedium.

This application claims the priority of the Japanese Patent ApplicationNo. 2002-199072 filed on Jul. 8, 2002, the entirety of which isincorporated by reference herein.

BACKGROUND ART

To compress a moving picture efficiently by coding, there have beenproposed digital moving picture coding techniques represented by MPEG-2(ISO/IEC 13818). In this image compression with the MPEG-2 technique, ahybrid conversion including a combination of inter-image motioncompensation and DCT (discrete cosine transform) is effected to makefurther quantization and variable-length coding of a signal resultedfrom the conversion.

The MPEG-2 technique adopts the bidirectional predictive codingtechnique to encode a moving picture. This bidirectional predictivecoding technique includes three types of coding: intra-frame coding,inter-frame forward predictive coding, and bidirectional predictivecoding. Moving pictures encoded by these types of bidirectionalpredictive coding techniques are called I (intra-coded), P (predicted)and B (bidirectionally coded) pictures, respectively. Also, I, P and Bpictures are appropriately combined to form a GOP (group of pictures)structure as a random access code. It should be noted here thatgenerally, I pictures are produced in a largest number, P pictures arein a next largest number and the B pictures are in a smallest number.

To produce an image by encoding a coded bit stream recorded in arecording medium accurately in a decoder at the time of reproductionwith a coding method in which I, P and B pictures are produced indifferent numbers, respectively, such as the MPEG-2 technique, it isnecessary to always know the data occupancy in an input buffer in thedecoder by means of an encoder.

FIG. 1 shows a transition in data occupancy of an MPEG stream suppliedto an input buffer of a decoder. In FIG. 1, a time (t) is indicated onthe horizontal axis along which times (t101, t102, t103, . . . ) atwhich pictures included in the supplied MPEG stream to be decoded areshown, and data occupancy in the input buffer is indicated on thevertical axis.

The input buffer sequentially stores the MPEG streams compressed withthe MPEG-2 technique at their respective bit rates. At the time t101 atwhich a VBV (video buffering verifier) delay (vbv_delay) has elapsedafter a time t100 at which the MPEG streams have started being supplied,a first picture will be extracted from the decoder for decoding. Thedata amount of the picture extracted from the decoder is a sum ofpicture_size, picture_start_code, sequence_header and GOP_header of thatpicture. The data amount will be referred to as “image size” hereunder.

Note that also after the time t101, the input buffer will continuouslybe supplied with MPEG streams in sequence at a predetermined bit rate.Also, at the times t102, t103, . . . elapsing at every ΔDTS (decode timestamp) after the time t101, data in each picture will be extracted bythe decoder in an amount corresponding to the image size of thatpicture. In such an input buffer, an overflow will arise when adifference in total data amount between the supplied MPEG streams andimage size of the picture extracted at each ΔDTS is larger than the sizeof the input buffer, and an underflow will arise when the difference issmaller than that size.

On this account, in the MPEG technique, it is assumed that the encoderhas a VBV (video buffering verifier) buffer provided as a virtual buffercorresponding to the input buffer in the decoder in order to control theamount of generated code data. At the encoder, the amount of generatedcode data is controlled for each picture type not to cause any failureof the VBV buffer, that is, not to cause data underflow or overflow ofthe VBV buffer.

Note here that new image data is recorded starting at a recording endpoint on the recording medium such as a magnetic tape on which imagedata has already been recorded, namely, so-called image splicing iseffected, in some cases. Also note that since the DV (digital video) VTR(video tape recorder) in which only intra-frame data is compressedrecords one frame over 10 tracks, so the splicing can easily be done bymaking switching from reproduction to recording while the tape isrunning, and recording image data resulted from compression of a frameto be recorded starting at a next track.

However, with the MPEG-2 technique in which the intra-frame compressionis used, it is not possible to record image data on a fixed number ofrecording tracks because the size of one frame varies. Therefore, theMPEG-2 technique is not capable of easy splicing.

As mentioned above, with the MPEG technique, it is necessary to controlthe amount of generated code data for each picture so that there willnot occur any data underflow or overflow of the input buffer at the timeof decoding, and splice new compressed image data to be recordedcorrespondingly to the size of the VBV buffer. More particularly, todecode image data without any failure of the input buffer even if imagedata before and after an edition point where splicing is to be done aresuccessively reproduced, it is necessary to acquire VBV_delay and DTS byreading auxiliary data of the existent image data from the recordingmedium, convert the image data into a data occupancy in the VBV buffer,and set the data occupancy as an initial value for the encoder.

Generally, when the data occupancy is low for the size of the VBVbuffer, the picture size will be limited for a picture whose amount ofgenerated code data is large not to underflow the VBV buffer, and thusno sufficient amount of code can be assigned to a complicated image or Ipicture, which will result in a lower image quality. On the other hand,if the data occupancy is high for the size of the VBV buffer, a stuffingwill easily arise to prevent overflowing of the VBV buffer, theeffective amount of generated code data is reduced correspondingly,which will also result in a lower image quality. On this account, theinitial value of the data occupancy in the VBV buffer has to be set toan optimum value with consideration given to the normal image quality.

The initial value of the data occupancy in the VBV buffer, set based ona VBV delay (VBV_delay) acquired by reading auxiliary data in existentimage data from a recording medium will no always be any optimum valueand underflow or overflow will take place, which will continuously causea lower image quality in many cases.

DISCLOSURE OF THE INVENTION

Accordingly, the present invention has an object to overcome theabove-mentioned drawbacks of the aforementioned conventional image dataprocessing apparatus and method by providing an improved and novel imagedata processing apparatus and method.

The present invention has another object to provide an image dataprocessing apparatus, capable of optimally controlling the dataoccupancy in a VBV buffer with little degradation of the image qualitywhatever the initial value of the data occupancy is.

To attain the above objects, the Inventors of the present inventionpropose an image data processing apparatus and an image data processingmethod, in which the initial value of a bit occupancy in a VBV buffer iscalculated on the basis of auxiliary data read from a recording mediumfor transition of the bit occupancy to a target value, the target andinitial values of the bit occupancy in the VBV buffer are compared witheach other and the number of bits for assignment to each GOP of imagedata to be coded is controlled correspondingly to the result ofcomparison.

More particularly, the above object can be attained by providing animage data processor for controlling the number of bits for assignmentto each GOP (group of pictures) of to-be-coded image data for transitionof the bit occupancy in a VBV buffer, used in decoding with the MPEGtechnique, to a target value, the apparatus including according to thepresent invention:

a calculating means for calculating the initial value of a bit occupancyin the VBV buffer on the basis of auxiliary data read from a recordingmedium;

a comparing means for making a comparison between the target and initialvalues of the bit occupancy; and

a controlling means for controlling the number of bits for assignment toeach GOP correspondingly to the result of comparison.

Also, the above object can be attained by providing an image dataprocessing method of controlling the number of bits for assignment toeach GOP (group of pictures) of to-be-coded image data for transition ofthe bit occupancy in a VBV buffer, used in decoding with the MPEGtechnique, to a target value, the method including, according to thepresent invention, the steps of:

calculating the initial value of a bit occupancy in the VBV buffer onthe basis of auxiliary data read from a recording medium;

making a comparison between the target and initial values of the bitoccupancy; and

controlling the number of bits for assignment to each GOPcorrespondingly to the result of comparison.

These objects and other objects, features and advantages of the presentinvention will become more apparent from the following detaileddescription of the best mode for carrying out the present invention whentaken in conjunction with the accompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows a transition in data occupancy of an MPEG stream suppliedto an input buffer of a decoder.

FIG. 2 is a block diagram of the image data processor according to thepresent invention.

FIG. 3 is a plan view of a magnetic tape having a recording track formedthereon.

FIG. 4 shows the construction of a helical track formed on the magnetictape.

FIG. 5 shows a data group.

FIG. 6 shows a transition in data occupancy of a data group supplied tothe image data processor.

FIG. 7 explains an example of a pre-calculation effected for recordingwhen a vbv_delay_n value of a next picture is unknown.

FIG. 8 explains operations of an ECC Bank memory in an ECC processor forsplicing.

FIG. 9 shows a flow of operations made in controlling the amount ofgenerated code data in an encoder.

FIGS. 10A and 10B explain an example of continuous insertion of copypictures when a vbv_occupancy_f value calculated on the basis of thevbv_delay_n value is smaller than a set one.

FIG. 11 explains an operation to be done when the vbv_delay_n valueinherited when splicing data streams of image data supplied from anotherelectronic device.

FIG. 12 explains the drawback of the splicing when a recording end pointis followed by a P picture.

FIG. 13 explains how to record a calculated number of copy pictures andthat of stuffing bytes.

FIG. 14 shows a relation of time vs. data occupancy in a VBV buffer forsecond splicing taking, as a re-recording start point, the top of a datagroup N1 having undergone a first splicing.

FIG. 15 explains addition of a PES header to only ES included in thestuffing byte.

FIG. 16 explains the re-recording start point for the second splicing.

FIG. 17 explains recording, to a magnetic tape, of both the copy pictureand stuffing byte.

BEST MODE FOR CARRYING OUT THE INVENTION

The present invention will be described in detail below concerning theembodiments of the image data processing apparatus and method withreference to the accompanying drawings.

Referring now to FIG. 2, there is schematically illustrated in the formof a block diagram an image data processor for encoding a moving pictureinto a digital moving picture for recording to a magnetic tape with theMPEG-2 (ISO/IEC 13818) technique with which a moving picture iscompressed efficiently by coding. As shown, the image data processor,generally indicated with a reference 1, includes an external input unit11, picture size measurement unit 12, encoder 13, inserting processor14, auxiliary-data generator 15, stream recording processor 16, ECC(error correction code) processor 17, recording circuit 18, reproductioncircuit 19, auxiliary-data extraction unit 20, stream reproducingprocessor 21, header extraction unit 22, VBV (video buffering verifier)display extraction unit 23, external output unit 24, decoder 25 and acontroller 26.

The above external input unit 11 is supplied with image data sent as TSs(transport stream) from any other external device, divides it into PESs(packetized elementary stream) and sends them to the stream recordingprocessor 16. It should be noted here that the size of each pictureincluded in image data supplied to the external input unit 11 ismeasured by the picture size measurement unit 12.

The above encoder 13 encodes image data supplied based on a VBV (videobuffering verifier) delay sent from the VBV delay extraction unit 23 onthe basis of encoding parameters including a picture type, quantizationstep, etc. The encoder 13 sends the encoded image data to the streamrecording processor 16.

The above inserting processor 14 generates a copy picture repeatedlyrepresenting a previous picture and a stuffing byte as dummy data whenthe amount of generated code data for encoding image data is small. Itshould be noted that the stuffing byte is data having no special meaningand it will be discarded at the decoder. The inserting processor 14outputs the copy picture and stuffing byte thus generated to the streamrecording processor 16.

The above auxiliary-data generator 15 outputs auxiliary data (AUX) addedto each data group led by an I or P picture and including a B picture tothe stream recording processor 16.

The stream recording processor 16 is supplied with image data from theexternal input unit 11 or encoder 13. Also, the stream recordingprocessor 16 is supplied with a copy picture and stuffing byte from theinserting processor 14, and also with auxiliary data from theauxiliary-data generator 15 and various headers from the headerextraction unit 22. The stream recording processor 16 inserts theauxiliary data, copy picture etc. between data groups beginning with anI or P picture, included in the image data, to generate one data stream.At this time, the stream recording processor 16 extracts a VBV delay bythe VBV delay extraction unit 23 from the generated data stream as thecase may be. The stream recording processor 16 sends the generated datastream to the ECC processor 17.

The ECC processor 17 adds an ECC (error correction code) to the inputdata stream and makes interleaving of the input data. The ECC processor17 includes a unique ECC Bank memory (not shown) to temporarily store adata stream which is to actually be recorded to a magnetic tape 4.

The recording circuit 18 records the data stream supplied from the ECCprocessor 17 to the magnetic tape 4. The recording circuit 18 convertsthe input data into serial data, amplifies the serial data and recordsit by a magnetic head (not shown) to the magnetic tape 4 rotated by arotating drum (not shown), for example.

The reproduction circuit 19 reproduces image data recorded on themagnetic tape 4, reads auxiliary data recorded in an auxiliary recordingarea on the magnetic tape 4, and sends the image data and auxiliary datato the ECC processor 17.

The stream reproducing processor 21 is supplied with the image datareproduced from the magnetic tape 4 and auxiliary data from thereproduction circuit 19 and ECC processor 17. The stream reproducingprocessor 21 outputs the input image data to the external output unit 24or decoder 25. From the auxiliary data supplied to the streamreproducing processor 21, PTS (presentation time stamp) and DTS(decoding time stamp) are extracted by the header extraction circuit 22and a VBV delay is extracted by the VBV delay extraction unit 23. Otherauxiliary data are extracted by the auxiliary-data extraction unit 20.

The external output unit 24 decodes image data supplied as PESs from thestream reproducing processor 21 to provide TSs (transport stream), andsends them to the other electronic device. The decoder 25 decodes theimage data supplied as PESs from the stream reproducing processor 21 onthe basis of encoding parameters including a picture type, quantizationstep, etc.

Note that circuits and elements included in the image data processor 1according to the present invention operate under the control of thecontroller 26.

Recording to the magnetic tape 4 in the image data processor 1 accordingto the present invention is done as will be described below. It shouldbe noted that the recording which will be described herein is based onthe technique disclosed in the Japanese Patent Application Laid Open No.2001-275077.

As shown in FIG. 3, the magnetic tape 4 has formed thereon helicaltracks 32 to which information such as video signals or the like isrecorded by a magnetic head.

The helical tracks 32 are formed oblique in relation to the length ofthe magnetic tape 4.

Each of the helical tracks 32 includes 123 sync blocks and 18 C2 paritysync blocks as shown in FIG. 4. Sixteen of the helical tracks 32 aretaken as a unit of interleaving for C2ECC in the ECC processor 17. TheECC processor 17 assigns sync blocks in 16 helical tracks 32 to the ECCsurface by interleaving to form a C2 parity, and records the C2 parityto the C2 parity sync block.

Each of the sync blocks includes a 2-byte sync pattern, 95-byte datapart, 1-byte sync block header (SB header), 3-byte ID part including atrack pair No., sync block No. etc., and a 10-byte C1 parity for thesepreceding data in this order. Namely, each sync block is of 111 bytes.

The ones of the helical tracks 32, adjacent in the order of negative andpositive azimuth, are identical in value to each other. A numberresulted from addition of one for only a positive-azimuth track to adouble of a track pair No. will be taken as a track No. Also, the SBheader has recorded therein the type of data recorded to the sync block(SB).

Note here that video and audio data formed as PES packets with theMPEG-2 technique are divided into sync blocks for recording. As shown inFIG. 5, the video data is a PES formed from a combination of threeframes including an I picture and B pictures or including a P pictureand B pictures. Audio data each corresponding to a PTS (presentationtime stamp) and video data are recorded alternately in this order in async block. The unit of audio and video data in combination will bereferred to as “Pack” hereunder. Video data formed from three framesincluding an I picture and B pictures or an P picture and B pictures inthis order is called “data group”.

Note here that an AUX-A sync block as auxiliary data for audio data andan AUX-V sync block as auxiliary data for video data are recorded ineach Pack.

The image data processor 1 constructed as above according to the presentinvention functions as will be described below:

Since the amount of generated code data is different from one picturetype to another, so the image data processor 1 using the MPEG-2technique has to always monitor the data occupancy in the input bufferin the decoder 25 by the encoder 13 in order to produce an image byaccurately encoding data stream recorded in the magnetic tape 4 at thedecoder 25 at the time of data reproduction.

FIG. 6 shows a transition in data occupancy, in the input buffer of thedecoder 25, of a last data group L supplied to the image data processor1. In FIG. 6, the horizontal axis indicates a time (t) at which picturesP, B1 and B2 included in the supplied data group L are decoded. Also,the vertical axis indicates the data occupancy in the input buffer.

The input buffer sequentially stores data streams compressed by encodingwith the MPEG-2 technique correspondingly to their bit rates. P pictureis stored for a period from a time t11 to t12, B1 picture is stored fora period from the time t12 to t13, and B2 picture is stored for a periodfrom the time t13 to t14. The decoder 25 extracts a P picture at a timet21 for decoding. Similarly, the decoder 25 extracts a B1 picture at atime t22 and a B2 picture at a time t23 for decoding.

The data amount of each picture extracted by the decoder 25 is a sum ofpicture data size (picture_size), data size of a picture start code(picture_start_code), data size of a sequence header (sequence_header)and data size of GOP header (GOP_header). The data amount will bereferred to as “image size” hereunder. A period from the time t11 to t21for which pictures are extracted by the decoder 25 after there issupplied a last byte of a picture start code of a P picture positionedat the top of the data group L will be referred to as “VBV delay(vbv_delay_1) hereunder.

As shown in FIG. 6, the data group L is followed by a picture which isto be inserted next to the data group L (will be referred to as “nextpicture” hereunder). The VBV delay (vbv_delay_n) of this next picture isa period from the time t14 to t15. When finally supplied with the datagroup L, the image data processor 1 can acquire a VBV delay(vbv_delay_n) of the next picture by encoding a slightly larger amountof data than necessary.

The image data processor 1 records the VBV delays (vbv_delay_1 andvbv_delay_n) that can thus be acquired, as auxiliary data, to an AUX-Vsync block provided in each of the data groups. In the bottom portion ofFIG. 6, there is shown a position on the magnetic tape 4 where an AUX-Vsync block provided for the data group L and next picture is recorded.The position where the AUX-V sync block for the data group L is recordedis provided before a P picture positioned at the top of the data groupL. Similarly, the AUX-V sync block for the next picture is providedbefore the position where the next picture is recorded and after theposition where the data group L is recorded.

The image data recorder 1 records the vbv_delay_1 having been acquiredfor the P picture in the data group L to the AUX-V sync block providedfor the data group L. Similarly, it records vbv_delay_n having beenacquired for the next picture to the AUX-V sync block provided form thenext picture.

By reproducing the magnetic tape 4 having the above data stream recordedtherein, it is possible to read vbv_delay_1 and vbv_delay_n recorded inthe AUX-V sync blocks, respectively. Thus, the image data processor 1can acquire existent image data even for recording new image datastarting at the recording end position of the existent image data on themagnetic tape 4, namely, even for so-called splicing. It should be notedthat image data having vbv_delay_1 or the like recorded therewith asabove for image data which is to be spliced is called “priming imagedata”.

More specifically, taking a next picture as image data to be spliced topredetermine vbv_delay_n the next picture should have, the image dataprocessor 1 can record image data to the magnetic tape 4. Thus, sincevbv_delay_n read from the magnetic tape 4 at the time of reproductioncan be converted into a data occupancy in the VBV buffer and set as aninitial value for the encoder, it is possible to control the amount ofgenerated code data for each picture even with the MPEG-2 technique inwhich the size of one frame varies, and easily splice image data withoutany failure of the input buffer.

Note that in the image data processor 1 according to the presentinvention, it is also possible to record, to the AUX-V sync block, anend point flag for indicating that the data group L is a last supplieddata group. Thus, when splicing image data, an area where image data isrecorded based on the end point flag can easily be identified, andoverwriting on existent image data can be prevented.

The image data processor 1 may be adapted to record the last supplieddata group L and next picture as well as all other data groups to theAUX-V sync group provided for each of the data groups by identifying aVBV delay of a top picture in each data group. Since the AUX-V syncblock of the next picture has also vbv_delay_n recorded therein,commonality in auxiliary-data type among all the AUX-V sync blocksprovided on the recording medium can be achieved by recording the VBVdelay to the AUX-V sync block for each picture.

Further, the image data processor 1 may use DTS or the like instead of aVBV delay as auxiliary data and record it to the AUX-V sync block. Ofcourse, DTS or PTS may be used in place of a VBV delay.

If DTS or PST supplied from any other electronic device is recorded asit is to the AUX-V sync block, the recorded DTS or PTS will possiblyjump at the time of reproduction. Normally, an offset value is added toDTS or PTS before recording to the AUX-V sync block. DTS acquired fromAUX-V of the data group L is taken as “DTS0”. Also, DTS acquired for anext picture to be spliced is taken as “DTS2”. At this time, the offsetvalue is calculated on the basis of a formula: DTS0−DTS2+(No. of copypictures)×(display time of copy picture), and added to DTS or PTS beforerecording.

For aborting an encoded data stream or a data stream supplied from anyother electronic device, the vbv_delay_n value of the next picture canbe recognized. However, when the data stream supplied from the otherelectronic device has completely been recorded down to the last picture,no next picture exists. In such a case, it is not possible to recognizethe vbv_delay_n value of the next picture, and record it as auxiliarydata to the AUX-V sync block at the time of recording. On this account,for recording a picture supplied from the other electronic device to themagnetic tape 4, the vbv_delay_n value of a next picture ispre-calculated at the time of recording, and recorded to the AUX-V syncblock of the next picture. Thus, the vbv_delay_n value of the nextpicture can easily be read out and splicing can easily be done withoutany failure of the input buffer.

FIG. 7 explains an example of the pre-calculation effected for recordingwhen the vbv_delay_n value of a next picture is unknown. The image dataprocessor 1 is supplied with a data group L supplied finally andincluding a P picture, B1 picture and B2 picture. At this time, theimage data processor 1 calculates the vbv_delay_n value of a picture tobe supplied next to the last supplied data group L from vbv_delay_1 ofthe P picture at the top of the data group L, a time (FT) fortransferring, and a time (ET) for displaying, the data group L by thefollowing equation (1):vbv_delay_(—) n=vbv_delay_(—)1+ET−FT  (1)

For the above transfer time FT, three frames forming the data group Lare extracted to calculate a sum of numbers of bits (d bits). Then, thesum d is divided by a bit rate to provide a time required for thetransfer, and the time thus obtained is multiplied by 90,000 to providea transfer time (FT) on the time base of 90 kHz which is the same asthat for the VBV delay. Also, the display time (ET) for the three framesincluded in the data group L is three times 3003 when the frame rate is29.97 Hz, and the difference between this display time (ET) and theabove transfer time (FT) is a variation of the VBV delay. Thus, avbv_delay_n value can be given by the following equation (2):vbv_delay_(—) n=vbv_delay_(—)1+3000×3−90000× d/bit rate  (2)

The image data processor 1 records the vbv_delay_n value thus determinedto the AUX-V sync block of the next picture. The similar method can beused to predetermine DTS of a next picture in case a VBV delay isrecorded to AUX-V as well as in case DTS is recorded to AUX-V.

As above, the image data processor 1 according to the present inventioncan determine a vbv_delay_n value of a next picture, even if it isunknown, based on the above equation (1) or (2). So, for obtaining aninitial value for the encoder at the time of reproduction, it becomesunnecessary to read all existent image data just before the recordingend position for calculation of a picture size. Thus, the image dataprocessor 1 according to the present invention can make a calculation ina reduced time and thus a transition to recording operation (REC) in areduced time.

Next, the operation of the ECC Bank memory in the ECC processor 17 willbe explained.

First, splicing by pausing a recording operation (REC) once (REC PAUSE)and making a recording operation (REC) again will be described. In caserecording a data stream encoded by the encoder 13 or a data streamsupplied via the external input unit 11 to the magnetic tape 4 is paused(REC PAUSE), a sync block when a data group L including last suppliedthree frame pictures is completely written to the ECC Bank is taken as arecording end point, and the AUX-A sync block of a Pack including a nextpicture to be spliced and sync block of audio data are written after therecording end point by making a recording operation (REC) again, asshown in FIG. 8. Finally, an AUX-V sync block to which auxiliary datasuch as vbv_delay_n of the next picture, END point flag, etc. arewritten.

The area extending from AUX-A to AUX-V as shown in FIG. 8 is an areawhen the auxiliary data starts being read and data stream to be splicedstarts being written at the time of splicing. It should be noted that incase this area extends from the ECC Bank including the AUX-A sync blockto a next ECC Bank, the sync block next to the AUX-V sync block of thenext picture and subsequent sync blocks are filled with Null data inorder to achieve commonality of the recording operations.

The ECC processor 17 records all supplied data stream to fill the ECCBank necessary for generation of priming image data with a sync block orNull data, then. stops supply of a recording current used for recordingto the magnetic tape 4 and operation of a mechanism which records a datastream to the magnetic tape 4, such as a rotating drum and the like (notshown). This is intended for supplying an excessive recording currentbecause stopping of supply of a recording current just after recordingdata to a last helical track for recording to the magnetic tape 4 willpossibly cause an error in the last helical track.

For splicing starting at a recording end point of priming image data onthe magnetic tape 4, the magnetic tape 4 is first reproduced, the datastream of the existent priming image data is written once to the ECCBank in the ECC processor 17 and an end point is searched in each of theAUX-V sync blocks. Only the ECC Bank including an AUX-V sync blockhaving such an end point added thereto and a next ECC Bank are stored inthe ECC Bank memory, and further writing to the ECC Bank memory issuspended for recording a next picture. At this time, the VBV delay, DTSor the like may be extracted from the AUX-V sync block having the endpoint flag added thereto.

Next, there will be explained how to designate a re-recording positionat which a next picture to be spliced starts being recorded whileviewing an image reproduced from the magnetic tape 4. In the ECC Bank,data streams of an image displayed on the screen when the reproductionis paused have overwritten thereon data streams of an image suppliedlater in many cases.

According to the present invention, each data group including threeframes is recorded to the magnetic tape 4. In case there exists an I orP picture in a position where a next picture designed by the user whileviewing a reproduced image is to be re-recorded, the next picture is tobe re-recorded just before the I or P picture. On the other hand, incase there exists a B picture in a position where a designed nextpicture is to be re-recorded, the next picture is to be recorded justbefore the I or P picture at the top of a data group including the Bpicture.

The ECC processor 17 determines a position where the next picture is tobe re-recorded correspondingly to a picture type existent in adesignated recording position, rewinds the magnetic tape 4 to thedetermined recording position, and sequentially writes the re-recordingpositions thus determined to the ECC Bank memory. At this time, thedetermined re-recording position or any I or P picture of a data groupimmediately following this re-recording position is searched on thebasis of DTS or the like, only an ECC Bank including AUX-A at the top ofthe Pack and a subsequent ECC Bank are stored into the ECC Bank memory,and writing subsequent ECC Bank to the ECC Bank memory is suspended forrecording a next picture. Also at this time, a VBV delay, DTS or thelike may be extracted from the AUX-V sync block in which an end pointflag exists.

For splicing without viewing any image reproduced from the magnetic tape4 and with selection of any re-recording position, the magnetic tape 4is reproduced to write data streams one after another into the ECC Bankmemory. At this time, each of the data groups is searched for are-recording position in an order in which they are to be reproduced.Only an ECC Bank including AUX-A at the top of I or P picture of a datagroup just after an arbitrary re-recording position and a subsequent ECCBank are stored in the ECC Bank memory, and then, writing further ECCBanks to the ECC Bank memory is suspended for recording a next picture.Also at this time, a VBV delay, DTS or the like may be extracted fromthe AUX-V sync block in which an end point flag exists.

Note that in case two ECC Banks are stored in the ECC Bank memory asabove, a new input data stream is returned from the ECC Bank as will bedescribed below. That is, the data stream in the sync block just beforethe re-recording position is left as it is in the ECC Bank memory. A newinput data stream is written over a sync block after the re-recordingposition and synthesized in the ECC Bank memory. At this time, for eachof the data streams in the ECC Bank memory in which the new data streamis overwritten and synthesized, a C2 parity is re-generated.

Then, the magnetic tape 4 is reproduced while viewing the track No. of adata stream going to be reproduced, and splicing is made starting at atrack whose number coincides with the track No. added to the ECC Bank.That is, when data streams before and after a data stream to be returnedare laid in succession on the magnetic tape 4, it is possible tosmoothly reproduce the data streams without making any special operationat the re-recording position where the splicing is started.

Next, there will be explained how to take over vbv_delay_n of a nextpicture recorded in AUX-V and set it as an initial value for the encoderat the time of reproducing the magnetic tape 4 having the priming imagedata formed thereon as above.

At the time of reproducing, the image data processor 1 acquiresvbv_delay_n of a next picture recorded in AUX-V, converts it into a dataoccupancy (vbv_occupancy) in the VBV buffer of the encoder 13, and setsa value thus obtained as an initial value of the encoder 13. The VBVbuffer is provided as a virtual buffer corresponding to the input bufferin the decoder 25 in order to control the amount of generated code datafor each picture. The vbv_occupancy in the VBV buffer can be calculatedby the following equation (3) on the basis of the taken-overvbv_delay_n:vbv_occupancy=vbv_delay_(—) n×bit rate/90000  (3)

Note here that the vbv_occupancy given by the above equation (3) doesnot always take an optimum value but will possibly cause an underflow oroverflow, whereby the image quality is continuously degraded. Thus,whatever value the vbv_occupancy given by the equation (3) takes, it isnecessary to optimally control the vbv_occupancy correspondingly to thecapacity of the VBV buffer for prevention of any degradation in imagequality.

By gradually correcting the vbv_occupancy beginning with thevbv_occupancy initial value (will be referred to as “vbv_occupancy_f”hereunder) calculated by the equation (3)), the image data processor 1provides a transition of the vbv_occupancy_f to an optimum target valueof vbv_occupancy (will be referred to as “vbv_occupancy_t” hereunder).More specifically, the image data processor 1 determines a differencebetween vbv_occupancy_f and vbv_occupancy_t, to thereby determine anecessary corrected amount of generated code data for convergence tovbv_occupancy_t. Then, the corrected amount of generated code data isdivided by a necessary number of GOPs (will be referred to as“number_GOP” hereunder) for transition to vbv_occupancy_t to determine acorrected amount of generated code data per GOP. That is, the correctedamount of generated code data can be calculated by the followingequation (4):Corrected amount of generated code data=(vbv_occupancy_(—)t−vbv_occupancy_(—) f)/number_GOP  (4)

As above, the image data processor 1 spends a plurality of GOPs fortransition from vbv_occupancy_f to vbv_occupancy_t. That is, since theamount of generated code data can gradually be corrected by multiplyingthe target vbv_occupancy by a plurality of GOPs (number_GOP) fortransition to the target value vbv_occupancy_t, it is possible to reducethe amount of correction per GOP and thus prevent temporary imagequality degradation.

FIG. 9 shows a flow of operations made in controlling the amount ofgenerated code data in the encoder 13. In FIG. 10, the direction ofarrow indicates the time base.

First in step S11, a difference between vbv_occupancy_f given by theequation (3) on the basis of vbv_delay_n, and vbv_occupancy_t isdetermined. Next in step S12, the difference is divided by number_GOP todetermine a corrected amount of generated code data per GOP. Then instep S13, a sum of code addition in each GOP controlled according to abit rate is corrected by subtracting the corrected amount of generatedcode data from the sum of code addition.

On the other hand, image data except for one at the top of GOP has theamount of generated code data subtracted from remain_bit_GOP at eachframe in step S21. In step S22, at the top of GOP, the sum of codeaddition corrected per GOP in step S13 is added to the code amount ofeach image data passing through step S21. Then in step S23, theintra-frame amount of generated code data based on encoding of data inunits of a frame is subtracted from the code amount of each image data.Thus, the encoder 13 can get remain_bit_GOP whose code amount has beencontrolled as above. Since the remain_bit_GOP has the code amountthereof controlled per GOP, so the image quality will not be degradedcontinuously.

The number_GOP may be set to any value, fixed at a given value or setfreely at each time correspondingly to the result ofvbv_occupancy_t−vbv_occupancy_f. On the assumption that number_GOP isfixed at a given value, it can be assigned uniformly to each GOPirrespectively of the result of vbv_occupancy_t−vbv_occupancy_f. Also,by setting number_GOP freely at each time correspondingly to the resultof vbv_occupancy_t−vbv_occupancy_f, it is possible to first determine anamount of correction per GOP and then set a necessary number_GOP.

The image data processor 1 assigns the above-mentioned remain_bit_GOP toeach picture. At this time, the assigned amount of code may be variedcorrespondingly to the complexity of each picture type.

On the assumption that a coefficient representative of the complexity ofI picture is Xi, coefficient representative of the complexity of Ppicture is Xp, coefficient representative of the complexity of B pictureis Xb, for example, the number of yet-to-be-encoded P pictures in GOP isNp and the number of yet-to-be-encoded B pictures in GOP is Nb, acoefficient Y_i assigned to the I picture, coefficient Y_p assigned tothe P picture and a coefficient Y_b assigned to the B picture can beexpressed by the following equations (5), (6) and (7), respectively:Y _(—) i=1 +Np·Xp/Xi·1/Kp+Nb·Xb/Xi·1/Kb  (5)Y _(—) p=Np+Nb·Xb/Xp·Kp/Kb  (6)Y _(—) b=Nb+Np·Xp/Xb·Kb/Kp  (7)where Kp=1.0 and Kb=1.4

Note here that by dividing remain_bit_GOP by the coefficients Y_i, Y_p,and Y_b assigned to the I, P and B pictures, respectively, determined asabove, it is possible to determine a code amount to be assigned to eachpicture. Also note that the initial value of each of Xi, Xp and Xb maybe 1.39×bit rate, 0.52×bit rate and 0.37×bit rate, respectively.

Next, there will be explained operations to be done when the value ofvbv_occupancy_f calculated based on the taken-over vbv_delay_n isextremely small.

If the value of vbv_occupancy_f calculated by the aforementionedequation (3) is extremely small, the image quality will considerably bedegraded for the following reasons even if a transition of the value ismade to vbv_occupancy_t on the basis of the equation (4).

If vbv_occupancy_f is extremely small because of the relation with anamount of generated code data of a next picture to be spliced, theamount of generated code data of the next picture will be limited for nounderflow of the VBV buffer at the time of encoding and thus the imagequality will be degraded. In such a case, if number_GOP is fixed at agiven value, some first GOPs have extremely low vbv_occupancy untilvbv_occupancy_t is reached. So, the image quality will considerably bedegraded and a long time will be taken until an optimum vbv_occupancy_tis reached. Therefore, the image quality cannot be improved soon.Further, if the corrected amount of generated code data per GOP isincreased to shorten the time for transition to vbv_occupancy_t, theimage quality will considerably be degraded for a time untilvbv_occupancy_t is reached.

On this account, the image data processor 1 according to the presentinvention is adapted to select image holding rather than a considerabledegradation of image quality by inserting a copy picture whenvbv_occupancy_f calculated by the equation (3) is smaller than a presetvalue in order to prevent the above image-quality degradation.

In case vbv_occupancy_f calculated based on vbv_delay_n is smaller thana set value as shown in FIG. 10A, copy pictures are continuouslyinserted as shown in FIG. 10B. Thus, the VBV delay (vbv_delay_n2)appears to be large because it corresponds to a time period from a timet41 to t42, and vbv_occupancy_f2 calculated based on the VBV delay willbe larger than the set value. Thus, the screen will be held for a longertime, but the image quality can be prevented from being degraded.

Note that the number of inserted copy pictures (N) is determined, bycalculation, so that vbv_occupancy_f2 obtained correspondingly tovbv_delay_n2 of a next picture is larger than the set value.

First, when N copy pictures are inserted, the time t42 at which a nextpicture is extracted will be delayed a time corresponding to the N copypictures and thus vbv_delay_n2 will be longer by the N copy pictures. Onthe other hand, the next picture will be shifted backward by N times thetransfer time FT for one copy picture, and thus vbv_delay_n2 will beshorter by a time corresponding to N times the transfer time FT.

On the assumption that the display time ET for one copy picture is ET,vbv_delay_n2 is given by the following equation (8):vbv_delay_(—) n2=vbv_delay_(—) n+N×(ET−FT)  (8)

Note that the display time ET for a copy picture is 3003 when the framefrequency is 29.97 Hz, and 3600 when the frame frequency is 25 Hz.

The number (N) of copy pictures is determined, by calculation, so thatvbv_delay_n2 is larger than a set value (vbv_delay_s) for vbv_delaycalculated by the equation (3) from the set value of vbv_occupancy. Thatis, the following formula (9) can be derived from the aforementionedequation (8):vbv_delay_(—) n+N×(ET−FT)≧vbv_delay_(—) s  (9)

The number (N) of copy pictures is given by the following formula (10)resulted from deformation of the formula (9):N≧(vbv_delay_(—) s−vbv_delay_(—) n)/(ET−FT)  (10)

In the image data processor 1 according to the present invention,vbv_delay_n2 can be obtained by inserting N copy pictures calculated asabove, and converted into a data occupancy in the VBV buffer. The dataoccupancy thus obtained can be taken as an initial value for theencoder. Thus, even if vbv_occupancy_f calculated by the equation (3) isextremely small, vbv_occupancy can optimally be controlled without anyconsiderable degradation of image quality.

Next, there will be explained operations to be done when splicing datastreams of image data supplied from any other electronic device when thetaken-over vbv_delay_n value is extremely small.

For splicing data streams supplied from the other electronic device,vbv_occupancy is controlled by inserting stuffing bytes in addition tocopy pictures.

In case vbv_occupancy_f calculated based on vbv_delay_n is smaller thana set value, copy pictures and stuffing bytes are inserted for a periodfrom a time t51 to t52 and stuffing bytes as shown in FIG. 11.

The number of copy pictures and that of stuffing bytes can be determinedas will be described below:

First, vbv_delay_n is acquired from AUX-V of a next picture positionedjust after a recording end point. Next, when image data to be spliced issupplied from the other electronic device, a VBV delay is acquired fromthe header of an I picture positioned at the top of the supplied imagedata and taken as vbv_delay_n3. Also, a bit rate represented in units of400 bps is acquired from the header of the next picture.

At this time, on the assumption that the number of bytes of the copypicture is B_copy, T_copy resulted from conversion of the transfer timeof the copy picture into units of 90 kHz can be given by the followingequation (11):T_copy=B_copy/bit rate×Conversion factor  (11)where the “conversion factor” is 1800 as given by the following equation(12) when the transfer time is converted in units of 90 kHz:90000 Hz×8 bits/400 bps=1800  (12)

The difference (VBVD_TN) of the VBV delay acquired as above can bedefined as given by the following equation (13):VBVD _(—) TN=vbv_delay_(—) n3−vbv_delay_(—) n  (13)

Note here that when VBVD_TN ≦0, the number of copy pictures (N_copy) istaken as 0 and only stuffing bytes are inserted. On the other hand, whenVBVD_TN >0, the number (N_copy), given by the following equation (14),of copy pictures is inserted. It should also be noted that in theequation (14), N_copy is rounded out to an integer:N_copy=VBVD _(—) TN/(ET−T_copy)  (14)

The rounded-out portion in the equation (14) is complemented withstuffing bytes (B_Stuf) given by the following equations (15) and (16):T_Stuf=(ET−T_copy)×N−VBVD _(—) TN  (15)B_Stuf=T_Stuf×Bit rate/1800  (16)

More particularly, when supplied with data streams from the otherelectronic device, the image data processor 1 according to the presentinvention can insert copy pictures or stuffing bytes correspondingly tothe acquired vbv_delay_n or vbv_delay_n3, respectively. Thus, copypictures or stuffing bytes can be inserted whatever value vbv_delay_nhas in relation to vbv_delay_n3, it is possible to control the dataoccupancy to a desired vbv_occupancy with little degradation of imagequality.

In case a picture just after the recording end point is a P picture andnext pictures led by an I picture are spliced to this P picture, the bitrate will go up according to the data amount of the sequence header/GOPheader as shown in FIG. 12. Therefore, it is necessary to subtract a VBVdelay corresponding to the sequence header/GOP header as a value ofcorrection from the determined vbv_delay_n.

Calculation of this correction value is made in an integral number ofsteps. If any fraction takes place in such a calculation, the fractionis rounded out, and then the bit rate is corrected according to the dataamount of the sequence header/GOP header. The correction value thuscalculated is used for calculation of the number of copy pictures andthat of stuffing bytes at the time of taking over vbv_delay_n of a nextpicture.

Next, how to record the calculated number of copy pictures and that ofstuffing bytes will be explained.

On the magnetic tape 4, there are already recorded data groups eachhaving AUX-V provided therein, led by an I or P picture and including aB picture as shown in FIG. 13. It should be noted that in FIG. 13, adata group L finally supplied to the image data processor 1 is shown asan example of priming image data.

In the re-recording position after the recording end point of the datagroup L, there will be recorded a data group N1 including a next picturegoing to be subjected to a first splicing. This data group N1 has alsoprovided therein AUX-V for recording auxiliary data.

Further, between the data groups L and N1, there is provided aninsertion auxiliary recording area (EditAUX_V_h) in which there will berecorded an insertion data group (EditPack_V_h) including a copy pictureand/or stuffing byte. The insertion data group EditPack_V_h is providedcorrespondingly to the bit occupancy of the VBV buffer.

The insertion data group EditPack_V_h including the copy picture andstuffing byte is recorded as a data group independent of the data groupsL and N1. Thus, only the insertion data group EditPack_V_h can beseparated depending upon the situation. A value corresponding to the VBVdelay of the stuffing byte is recorded in the insertion auxiliaryrecording area EditAUX_V_h. At this time, vbv_delay_n recorded in AUX-Vof the data group N1 may be taken over and recorded to EditAUX_V_h.

For re-recording another image data in a re-recording position on arecording medium where the first splicing has been done, namely, formaking a second splicing, the insertion data group EditPack_V_h isseparated for removal. Then, a second data group N2 to be spliced isrecorded as shown in FIG. 13. This data group N1 has also providedtherein AUX_V in which auxiliary data is to be recorded. Further,between the data groups L and N2, there is provided an insertionauxiliary recording area (EditAUX_V_h2) where an insertion data group(EditPack_V_h2) including a copy picture and/or stuffing byte isrecorded.

By removing, in the second splicing, the insertion auxiliary data groupEditPack_V_h having been recorded in the first splicing, the effect canbe assured as will be described below:

FIG. 14 shows a relation of time vs. data occupancy in the VBV bufferfor the second splicing taking, as a re-recording start point, the topof a data group N1 having undergone the first splicing. As shown in FIG.14, the VBV delay (vbv_delay_h2) of the data group N2 is larger than theVBV delay (vbv_delay_h1) of the data group N1, and smaller the VBV delay(vbv_delay_n) of the data group L. Therefore, although it will sufficeto determine the number of copy pictures and that of stuffing bytes, tobe inserted, by making a comparison between vbv_delay_h2 andvbv_delay_n, an unnecessary stuffing byte or the like has already beenrecorded via the insertion data group (EditPack_V_h) because of therelation between vbv_delay_n and vbv_delay_h1 in the first splicing.

In the image data processor 1 according to the present invention,EditPack_V_h including the stuffing byte or the like for the firstsplicing has been removed before the data group N2 is supplied.Therefore, a number of stuffing bytes to be inserted can be determinedby making a comparison between vbv_delay_h2 and vbv_delay_n withdisregarding vbv_delay_h1. Also, no unnecessary stuffing byte or thelike will be recorded and any useless screen hold can be prevented.

On the other hand, also in case a copy picture and stuffing byte areinserted because vbv_delay_h1 is larger than vbv_delay_n, EditPack_V_hhas been removed before the data group N2 is supplied. Therefore, thenumber of copy pictures and that of stuffing bytes can be determined bymaking a comparison between vbv_delay_h2 and vbv_delay_n withdisregarding vbv_delay_h1. Also, no unnecessary copy picture andstuffing byte or the like will be recorded and thus any useless screenhold can be prevented.

Note that in case EditPack_V_h1 is composed of only a stuffing byte, aPES header is added to only ES included in the stuffing byte as shown inFIG. 15.

Thus, it becomes unnecessary to form an PES packet by combining ESforming only a stuffing byte with an other ES and thus the boundary ofthe stuffing will be defined. Thus, it is possible at the time ofdecoding to easily remove a stuffing byte to which the PES header hasbeen added.

Next, there will be explained the re-recording position in the secondsplicing:

FIG. 16 shows vbv_delay_h1 starting at a time t62 with a copy pictureand stuffing byte being inserted in relation to vbv_delay_n starting ata time t61. At this time, the second splicing is effected andvbv_delay_h2 having an additional stuffing byte added thereto will startat a time t63 delayed by the additional stuffing byte from the time t62.

At this time, even if an accurate additional number of stuffing bytes isdetermined by making a comparison between vbv_delay_h2 and vbv_delay_n,a useless screen hold for the stuffing byte or the like in EditPack_V_hhaving been removed in the second splicing will take place when therecording start position is the time t63. Therefore, according to thepresent invention, the recording start position in the second splicingis controlled to be a time t71 which is delayed by the additional numberof stuffing bytes from the time t61 when vbv_delay_n starts.

That is, EditPack_V_h having recorded therein the number of stuffingbytes which is for the first splicing is removed once, a new additionalnumber of stuffing bytes is determined by making a comparison betweenvbv_delay_h2 and vbv_delay_n, and the number of stuffing bytes thusdetermined is inserted before the next picture. Thus, it is possible toreduce useless screen hold.

Note that EditAUX_V_h may have recorded therein a copy pictureidentification flag and a flat for identification of the number of copypictures.

Also note that in case both a copy picture and stuffing byte are to berecorded to the magnetic tape 4, the copy picture is first recorded, andthen a stuffing byte is recorded after the copy picture, as shown inFIG. 17. Thus, it is possible to prevent any underflow.

In the foregoing, the present invention has been described in detailconcerning certain preferred embodiments thereof as examples withreference to the accompanying drawings. However, it should be understoodby those ordinarily skilled in the art that the present invention is notlimited to the embodiments but can be modified in various manners,constructed alternatively or embodied in various other forms withoutdeparting from the scope and spirit thereof as set forth and defined inthe appended claims.

INDUSTRIAL APPLICABILITY

As having been described in the foregoing, the image data processingapparatus and method according to the present invention control thenumber of bits for assignment to each GOP of to-be-coded image data tomake a transition of the bit occupancy in a VBV buffer to a target valuecalculating the initial value of a bit occupancy in the VBV buffer onthe basis of auxiliary data read from a recording medium, making acomparison between the target and initial values of the bit occupancy,and controlling the number of bits for assignment to each GOPcorrespondingly to the result of comparison.

Thus, the image data processing apparatus and method according to thepresent invention can control the data occupancy in a VBV buffer withoutdegradation of the image quality because it is possible to insert a copypicture and also a stuffing byte whatever value the auxiliary data readfrom a recording medium takes. Also, since the amount of generated codedata can gradually be corrected by multiplying a target value of the bitoccupancy by a plurality of GOPs (number_GOP), it is possible to reducethe amount of correction per GOP and thus prevent temporary imagequality degradation.

1. An image data processor for controlling the number of bits forassignment to each GOP (group of pictures) of to-be-coded image data fortransition of the bit occupancy in a VBV (video buffering verifier)buffer, used in decoding with the MPEG technique, to a target value, theapparatus comprising: a calculating means for calculating the initialvalue of a bit occupancy in the VBV buffer on the basis of auxiliarydata read from a recording medium; a comparing means for making acomparison between the target and initial values of the bit occupancy;and a controlling means for controlling the number of bits forassignment to each GOP correspondingly to the result of comparison. 2.The apparatus according to claim 1, wherein: the comparing meansdetermines a difference between the target and initial values of the bitoccupancy; and the controlling means controls the number of bits forassignment to each GOP on the basis of a value resulted from division ofthe difference determined by the comparing means by the number of GOPs.3. The apparatus according to claim 1, wherein the controlling meansfurther assigns the number of bits assigned to each GOP to each ofpictures included in the GOP correspondingly to the type of a picture.4. The apparatus according to claim 1, wherein the calculating meansreads, from the recording medium, a next VBV delay (VBV_delay_N) to beinserted as the auxiliary data.
 5. The apparatus according to claim 1,wherein in case the initial value of the bit occupancy is smaller thanthe target one, the controlling means inserts at least one copy picturerepeatedly representing a previous picture to before an I picture. 6.The apparatus according to claim 5, wherein in case the initial value ofthe bit occupancy is smaller than a set value R, the controlling meansdetermines an initial value VBV_delay_S of a video encodercorrespondingly to a VBV_delay_N, number (N) of copy pictures to beinserted, display time (ET) for the copy picture and a transfer time(FT) of the copy picture.
 7. The apparatus according to claim 6, whereinthe initial value VBV_delay_S is calculated based on the followingformula:VBV_delay_(—) S=VBV_delay_(—) N+N×(ET−FT).
 8. The apparatus according toclaim 5, wherein the number (N) of copy pictures to be inserted is asgiven by the following formula:N≧(Set value R−VBV_delay_(—) N)/(ET−FT).
 9. The apparatus according toclaim 4, wherein: the comparing means reads a VBV delay (VBV_delay_I) ofan I picture at the top of externally entered image data; and thecontrolling means inserts at least one copy picture to before the Ipicture correspondingly to a difference between the VBV_delay_N andVBV_delay_I or inserts a stuffing byte.
 10. The apparatus according toclaim 9, wherein in case the difference between the VBV_delay_N andVBV_delay_I is 0 or less, the controlling means inserts only thestuffing byte without insertion of any copy picture.
 11. The apparatusaccording to claim 9, wherein in case the difference between the VBVdelay _N and VBV_delay_I is larger than 0, the controlling means insertsat least one copy picture and a stuffing byte.
 12. The apparatusaccording to claim 4, wherein in case the last picture recorded in therecording medium is a P picture, the controlling means corrects theVBV_delay_N correspondingly to the size of a sequence header and that ofa GOP header.
 13. An image data processing method of controlling thenumber of bits for assignment to each GOP (group of pictures) ofto-be-coded image data for transition of the bit occupancy in a VBV(video buffering verifier) buffer, used in decoding with the MPEG(Moving Picture Experts Group) technique, to a target value, the methodcomprising the steps of: calculating, using an image data processor, theinitial value of a bit occupancy in the VBV buffer on the basis ofauxiliary data read from a recording medium; making a comparison betweenthe target and initial values of the bit occupancy; and controlling thenumber of bits for assignment to each GOP correspondingly to the resultof comparison.
 14. The method according to claim 13, wherein: adifference between the target and initial values of the bit occupancy isdetermined; and the number of bits for assignment to each GOP iscontrolled on the basis of a value resulted from division of thedifference determined by the comparing means by the number of GOPs. 15.The method according to claim 13, wherein the number of bits assigned toeach GOP is further assigned to each of pictures included in the GOPcorrespondingly to the type of a picture.
 16. The method according toclaim 13, wherein a next VBV delay (VBV_delay_N) to be inserted is readas the auxiliary data from the recording medium.
 17. The methodaccording to claim 13, wherein in case the initial value of the bitoccupancy is smaller than the target one, at least one copy picturerepeatedly representing a previous picture is inserted to before an Ipicture.
 18. The method according to claim 17, wherein in case theinitial value of the bit occupancy is smaller than a set value R, aninitial value VBV_delay_S of a video encoder is determinedcorrespondingly to a VBV_delay_N, number (N) of copy pictures to beinserted, display time (ET) for the copy picture and a transfer time(FT) of the copy picture.
 19. The method according to claim 18, whereinthe initial value VBV_delay_S is calculated based on the followingformula:VBV_delay_(—) S=VBV_delay_(—) N+N×(ET−FT).
 20. The method according toclaim 17, wherein the number (N) of copy pictures to be inserted is asgiven by the following formula:N≧(Set value R−VBV_delay_(—) N)/(ET−FT).
 21. The method according toclaim 16, wherein: a VBV delay (VBV_delay I) of an I picture at the topof externally entered image data is read; and at least one copy pictureis inserted to before the I picture correspondingly to a differencebetween the VBV_delay_N and VBV_delay_I or inserts a stuffing byte. 22.The method according to claim 21, wherein in case the difference betweenthe VBV_delay_N and VBV_delay_I is 0 or less, only the stuffing byte isinserted without insertion of any copy picture.
 23. The method accordingto claim 21, wherein in case the difference between the VBV_delay_N andVBV_delayI is larger than 0, at least one copy picture and a stuffingbyte are inserted.
 24. The method according to claim 16, wherein in casethe last picture recorded in the recording medium is a P picture, theVBV_delay_N is corrected correspondingly to the size of a sequenceheader and that of a GOP header.